package nkr1pt.popkorn.helper;

import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;

/**
 * Wrapper to make the final class java.net.URL testable
 *
 * @author Kristof Vanhaeren
 */
public class URLWrapper {

    private URL url;

    public URLWrapper(URL url) {
        this.url = url;
    }

    public URLConnection openConnection() throws IOException {
        return url.openConnection();
    }

    public String getFile() {
        return url.getFile();
    }

    @Override
    public String toString() {
        return url.toString();
    }
}